------------------------------------------------------------------------------------------------------------------------
       log:  C:\My Documents\Jan - PID paper\1980 NES Panel\Steps for GLAMM Ready Data.log
  log type:  text
 opened on:   5 Oct 2004, 13:45:53

. drop if t==1
(728 observations deleted)

. tab t

          t |      Freq.     Percent        Cum.
------------+-----------------------------------
          2 |        728       33.33       33.33
          3 |        728       33.33       66.67
          4 |        728       33.33      100.00
------------+-----------------------------------
      Total |       2184      100.00

. gen y_glamm=y+1

. edit
- preserve
- label var y "0=Ind; 1=D; 2=R"
- label var y_glamm "1=Ind; 2=D; 3=R"
- preserve

. tab y_glamm

1=Ind; 2=D; |
        3=R |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        719       32.92       32.92
          2 |        880       40.29       73.21
          3 |        585       26.79      100.00
------------+-----------------------------------
      Total |       2184      100.00

. tab y

0=Ind; 1=D; |
        2=R |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        719       32.92       32.92
          1 |        880       40.29       73.21
          2 |        585       26.79      100.00
------------+-----------------------------------
      Total |       2184      100.00

. sort id t

. edit
- preserve

. gen patt=_n

. expand 3
no room to add more observations
    An attempt was made to increase the number of observations beyond what is currently possible.  You have the
    following alternatives:

     1.  Store your variables more efficiently; see help compress.  (Think of Stata's data area as the area of a
         rectangle; Stata can trade off width and length.)

     2.  Drop some variables or observations; see help drop.

     3.  Increase the amount of memory allocated to the data area using the set memory command; see help memory.
r(901);

. save "C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta", replace
file C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta saved

. clear

. use "C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta", clear

. clear

. set mem 100m
(102400k)

. use "C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta", clear

. sort id t

. edit
- preserve

. drop patt

. sort id t

. gen patt=_n

. expand 3
(4368 observations created)

. edit
- preserve

. sort patt

. qui by patt: gen alt=_n

. gen chosen=alt==y_glamm

. sort patt alt

. list  id t patt alt chosen y_glamm in 1/30

            id          t       patt        alt     chosen    y_glamm
  1.         1          2          1          1          1          1
  2.         1          2          1          2          0          1
  3.         1          2          1          3          0          1
  4.         1          3          2          1          1          1
  5.         1          3          2          2          0          1
  6.         1          3          2          3          0          1
  7.         1          4          3          1          1          1
  8.         1          4          3          2          0          1
  9.         1          4          3          3          0          1
 10.         2          2          4          1          0          2
 11.         2          2          4          2          1          2
 12.         2          2          4          3          0          2
 13.         2          3          5          1          0          2
 14.         2          3          5          2          1          2
 15.         2          3          5          3          0          2
 16.         2          4          6          1          0          2
 17.         2          4          6          2          1          2
 18.         2          4          6          3          0          2
 19.         3          2          7          1          0          2
 20.         3          2          7          2          1          2
 21.         3          2          7          3          0          2
 22.         3          3          8          1          0          2
 23.         3          3          8          2          1          2
 24.         3          3          8          3          0          2
 25.         3          4          9          1          0          2
 26.         3          4          9          2          1          2
 27.         3          4          9          3          0          2
 28.         5          2         10          1          0          3
 29.         5          2         10          2          0          3
 30.         5          2         10          3          1          3

. tab alt, gen(a)

        alt |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |       2184       33.33       33.33
          2 |       2184       33.33       66.67
          3 |       2184       33.33      100.00
------------+-----------------------------------
      Total |       6552      100.00

. save "C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta", replace
file C:\My Documents\Jan - PID paper\1980 NES Panel\1980 Balanced Panel Data - GLAMM Format.dta saved

. log close
       log:  C:\My Documents\Jan - PID paper\1980 NES Panel\Steps for GLAMM Ready Data.log
  log type:  text
 closed on:   5 Oct 2004, 13:57:22
------------------------------------------------------------------------------------------------------------------------
